import {HttpRequest} from '@/utils/request'
import ApiPrefix from '@/config/prefix'
import type {ResponseType} from '@/interface/core/entity'
import type {LoginRequest,LoginResponse} from './typings'

const request=new HttpRequest()

export const getCaptcha=()=>{
    const timestamp = new Date().getTime();
    return request.get<ResponseType<string>,{}>(`${ApiPrefix.platformApi}/Common/GetLoginImgBase64?timestamp=${timestamp}`, {})
}

export const login=(params:LoginRequest)=>{
    return request.post<ResponseType<LoginResponse>,LoginRequest>(`${ApiPrefix.platformApi}/Common/Login`,params)
}